package com.pro.common.user.task.model.mapstruct;

import com.pro.common.api.depencies.config.CommonMappingConfig;
import com.pro.common.api.model.ILoginInfo;
import com.pro.common.api.user.task.model.base.IUserTaskCreate;
import com.pro.common.api.user.task.model.base.IUserTaskStepCallNotify;
import com.pro.common.api.user.task.model.base.IUserTaskStepNotify;
import com.pro.common.api.user.task.model.db.UserTask;
import com.pro.common.api.user.task.model.db.UserTaskStep;
import com.pro.common.api.user.task.model.db.UserTaskStepCall;
import com.pro.common.api.user.task.model.dto.UserTaskStepCreateDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.NullValuePropertyMappingStrategy;

@Mapper(
        componentModel = "spring",
        config = CommonMappingConfig.class,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE
)
@Schema(description = "采集到的商品基础信息 抽取部分信息到货源信息")
public interface UserTaskMapper {
    @InheritConfiguration(name = "ignoreBaseFields")
    UserTask build(IUserTaskCreate source);

    @InheritConfiguration(name = "ignoreBaseFields")
    void update(ILoginInfo source, @MappingTarget UserTask target);

    @InheritConfiguration(name = "ignoreBaseFields")
    void update(UserTaskStep source, @MappingTarget UserTaskStep target);

    @InheritConfiguration(name = "ignoreBaseFields")
    void update(IUserTaskStepNotify source, @MappingTarget UserTaskStep target);


    @InheritConfiguration(name = "ignoreBaseFields")
    UserTaskStepCall build(IUserTaskStepCallNotify source);

    @InheritConfiguration(name = "ignoreBaseFields")
    void update(UserTaskStep source, @MappingTarget UserTaskStepCall target);
    @InheritConfiguration(name = "ignoreBaseFields")
    void update(UserTaskStepCreateDTO source, @MappingTarget UserTaskStep target);
}
